﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace WFDataBaseProject.Helpers
{
    public class ToStringConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string val = (string)value;
            if (string.IsNullOrEmpty(val))
            {
                return SqlSourceLocation.InLine;
            }
            switch (val)
            {
                case "SqlSourceLocation.InLine":
                    return SqlSourceLocation.InLine;
                case "SqlSourceLocation.TextFile":
                    return SqlSourceLocation.TextFile;
                case "SqlSourceLocation.SqlFile":
                    return SqlSourceLocation.SqlFile;
                default:
                    return SqlSourceLocation.InLine;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
